local function sinal()
	local evt = {
		  class = 'ncl',
		  type  = 'attribution',
		  action = 'start',
		  name  = 'sinal',
		  value = "1",
	       }
	event.post(evt)
	evt.action = 'stop'
	event.post(evt)
end

function desenha()
	local cw, ch = canvas:attrSize()
	local texto = "Hello Word"
	canvas:attrColor('silver')
	canvas:drawText(10,10, texto)
	canvas:flush()
end

local function alteraArquivo()
	local arq = 'texto.txt'
	local conteudo = 'FUNCIONOU DE NOVO!!!!'

	file = io.open(arq,"w")
	
	if (file == nil) then
    		io.output(arq)
    		io.close()
		return
	end
	
	file:write(conteudo)
	file:close()
end

function sleep(time) --in sec
	local TimeToStop = os.time() + tonumber(time)
		while os.time() < TimeToStop do
   	end
end

event.timer(1000, sinal)
